//
//  ThirdLoginView.m
//  KeleAppProject
//
//  Created by 周岑 on 2018/1/12.
//  Copyright © 2018年 Cen Zhou. All rights reserved.
//

#import "ThirdLoginView.h"

@interface ThirdLoginView()

@end

@implementation ThirdLoginView

- (instancetype)init{
    if (self = [super init]) {
        [self loadSubviewsOnThirdLogin];
    }
    return self;
}

//加载视图

- (void)loadSubviewsOnThirdLogin{
    UIView *tintView = [[UIView alloc]init];
    tintView.backgroundColor = [UIColor whiteColor];
    [self addSubview:tintView];
    [tintView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.right.equalTo(self);
        make.height.mas_offset(17*HEIGHT);
    }];
    
    UIView *leftLineView = [[UIView alloc]init];
    leftLineView.backgroundColor = KLColor_B3;
    [tintView addSubview:leftLineView];
    [leftLineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(tintView);
        make.left.equalTo(tintView).offset(25*WIDTH);
        make.height.mas_offset(1);
        make.width.mas_equalTo(120*WIDTH);
    }];
    
    UILabel *tint = [[UILabel alloc]init];
    tint.text = @"快捷登录";
    tint.textColor = KLColor_B4;
    tint.font = [UIFont fontWithName:@"PingFangSC-Regular" size:12*WIDTH];
    [tintView addSubview:tint];
    [tint mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(tintView);
        make.centerY.equalTo(tintView);
    }];
    
    UIView *rightLineView = [[UIView alloc]init];
    rightLineView.backgroundColor = KLColor_B3;
    [tintView addSubview:rightLineView];
    [rightLineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(tintView);
        make.right.equalTo(tintView).offset(-25*WIDTH);
        make.height.mas_offset(1);
        make.width.mas_equalTo(120);
    }];
    
    
    UIButton *qqLoginBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [qqLoginBtn setBackgroundImage:[UIImage imageNamed:@"login_icon_qq"] forState:UIControlStateNormal];
    [self addSubview:qqLoginBtn];
    self.qqLoginBtn = qqLoginBtn;
    [qqLoginBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.height.mas_equalTo(38*WIDTH);
        make.centerX.equalTo(self);
        make.top.equalTo(tintView.mas_bottom).offset(33*HEIGHT);
    }];
    
    UIButton *wechatLoginBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [wechatLoginBtn setBackgroundImage:[UIImage imageNamed:@"login_icon_weixin"] forState:UIControlStateNormal];
    [self addSubview:wechatLoginBtn];
    self.wechatLoginBtn = wechatLoginBtn;
    [wechatLoginBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.height.mas_equalTo(38*WIDTH);
        make.right.equalTo(self.mas_centerX).offset(-79*WIDTH);
        make.top.equalTo(tintView.mas_bottom).offset(33*HEIGHT);
    }];
    
    UIButton *weiboLoginBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [weiboLoginBtn setBackgroundImage:[UIImage imageNamed:@"login_icon_xinlang"] forState:UIControlStateNormal];
    [self addSubview:weiboLoginBtn];
    self.weiboLoginBtn = weiboLoginBtn;
    [weiboLoginBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.height.mas_equalTo(38*WIDTH);
        make.left.equalTo(self.mas_centerX).offset(79*WIDTH);
        make.top.equalTo(tintView.mas_bottom).offset(33*HEIGHT);
    }];
    
    
}

@end
